<?php
defined('_JEXEC') or die('Restricted access');
JToolBarHelper::title(JText::_('COM_JHTRAQ_USER_LIST'), 'generic.png');
$bar = & JToolBar::getInstance('toolbar');
$bar->appendButton( 'Popup', 'assign', JText::_('COM_JHTRAQ_USER_GROUPS'), 'index.php?option=com_jhtraq&amp;view=users&amp;task=grouplist', 400, 300 );
//JToolBarHelper::preferences('com_jhtraq');
?>
<?php JHTML::_('behavior.tooltip'); ?>

<form action="index.php" method="post" name="adminForm" autocomplete="off">
<input type="hidden" name="option" value="com_jhtraq" />
<input type="hidden" name="view" value="users" />

<fieldset class="adminform">
<table>
		<tr>
			<td width="100%">
				<?php echo JText::_('COM_JHTRAQ_FILTER'); ?>:
				<input type="text" name="search" id="search" value="<?php echo $this->search;?>" class="text_area" onchange="document.adminForm.submit();" />
				<button onclick="this.form.submit();"><?php echo JText::_( 'COM_JHTRAQ_GO' ); ?></button>
		</tr>
	</table>
<table width="100%" cellspacing="0" class="adminlist">
	<thead>
		<tr>
			<th>#</th>
			<th><?php echo JText::_('COM_JHTRAQ_USERNAME');?></th>
			<th><?php echo JText::_('COM_JHTRAQ_EMAIL');?></th>
			<th><?php echo JText::_('COM_JHTRAQ_USER_GROUP');?></th>
			<th></th>
		</tr>
	</thead>
	<tfoot>
		<tr>
		<th colspan="5"><?php echo $this->pagination->getListFooter(); ?></th>
	</tfoot>
	<tbody>
	  <?php
	  $r = 0;
	  foreach($this->users as $user)
	  {
		  ?>
		  <tr class="row<?php echo $r;?>">
			<td><?php echo $user['id'];?></td>
			<td><a href="index.php?option=com_jhtraq&view=users&task=edit&id=<?php echo $user['id'];?>"><?php echo $user['username'];?></a></td>
			<td><?php echo $user['email'];?></td>
			<td><?php
				echo ($user['group_id'] == 1)?JText::_('Admin'):JText::_('User');?>
				</td>
			<td></td>
		  </tr>
		 <?php 
	  }
	  ?>
	</tbody>
	

</table>
</fieldset>
</form>